import request from '@/utils/request'

// 获取用户节点列表
export function selectUserOptions(changeId) {
  return request({
    url: '/engineering/change/detail/selectUserOptions/' + changeId,
    method: 'get'
  })
}

// 查询变更令申报详情列表
export function listDetail(query) {
  return request({
    url: '/engineering/change/detail/list',
    method: 'get',
    params: query
  })
}

// 查询变更令申报详情详细
export function getDetail(changeDetailId) {
  return request({
    url: '/engineering/change/detail/' + changeDetailId,
    method: 'get'
  })
}

// 新增变更令申报详情
export function addDetail(data) {
  return request({
    url: '/engineering/detail',
    method: 'post',
    data: data
  })
}

// 修改变更令申报详情
export function updateDetail(data) {
  return request({
    url: '/engineering/change/detail',
    method: 'put',
    data: data
  })
}

// 删除变更令申报详情
export function delDetail(changeDetailId) {
  return request({
    url: '/engineering/change/detail/' + changeDetailId,
    method: 'delete'
  })
}

// 查询未分配的计量清单
export function unallocatedMeterageList(query) {
  return request({
    url: '/engineering/change/detail/unallocatedMeterageList',
    method: 'get',
    params: query
  })
}

// 新增变更计量清单
export function save(data) {
  return request({
    url: '/engineering/change/detail/save',
    method: 'post',
    params: data
  })
}
